package base;

import java.util.*;

/**
 * 
 */
public class Product {

    /**
     * Default constructor
     */
    public Product(String code, String description, double price) {
        this.code = code;
        this.description = description;
        this.price = price;
    }

    /**
     * Code of the product
     */
    private String code;

    /**
     * Description of the product
     */
    private String description;

    /**
     * Price of the product
     */
    private double price;


    /**
     * @return the code of this product
     */
    public String getCode() {

        return code;
    }

    /**
     * @return the description of this product
     */
    public String getDescription() {

        return description ;
    }

    /**
     * @return the price of this product
     */
    public double getPrice() {

        return price;
    }

    /**
     * @return
     */
    //in Product
    public String toString() {
        return getCode() + "-" + getDescription() + "-" + getPrice() + '\n';
    }

    public String print() {
        return getCode() + "-" + getDescription() + "-" + getPrice() + '\n';
    }

    /**
     * Determine if products are equal
     * @param b product of comparison
     * @return isequal
     */
    //in Product
    public Boolean equals(Product b) {
        return code.equals(b.code);
    }

}